<%@ include file="/jsps/main.jsp"%>

<%
long songId = ParamUtil.getLong(request, "songId");
Song song = null;
if(songId > 0) {
	song = SongLocalServiceUtil.getSong(songId);
}
%>

<aui:layout cssClass="portlet-layout">
	<c:choose>
		<c:when test="<%= song == null %>">
			<div class="portlet-msg-error"><liferay-ui:message key="no-song-found"/></div>
		</c:when>
		<c:otherwise>
			<table class="table song-table">
				<tr>
					<th><liferay-ui:message key="songId"/></th>
					<td><%=song.getSongId() %></td>
				</tr>
				<tr>
					<th><liferay-ui:message key="songName"/></th>
					<td><%=song.getSongName() %></td>
				</tr>
				<tr>
					<th><liferay-ui:message key="songAuthor"/></th>
					<td><%=song.getSongAuthor() %></td>
				</tr>
				<tr>
					<th><liferay-ui:message key="songCategory"/></th>
					<td><%=song.getSongCategory() %></td>
				</tr>
				<tr>
					<th><liferay-ui:message key="songSinger"/></th>
					<td><%=song.getSongSinger() %></td>
				</tr>
				<tr>
					<th><liferay-ui:message key="recordNumber"/></th>
					<td><%=String.valueOf(song.getRecordNumber()) %></td>
				</tr>
				<tr>
					<%
					PortletURL renderUrl = renderResponse.createRenderURL();
					renderUrl.setParameter("jspPage", "/jsps/phong-thu/record.jsp");
					renderUrl.setParameter("tab", "phong-thu");
					renderUrl.setParameter("songId", String.valueOf(songId));
					renderUrl.setPortletMode(PortletMode.VIEW);
					%>
					<th></th>
					<td><a href="<%=renderUrl.toString()%>"><liferay-ui:message key="thu-am-bai-hat-nay"/></a></td>
				</tr>
			</table>
		</c:otherwise>
	</c:choose>
</aui:layout>